package pms.common.dao;

import java.sql.SQLException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;

public class DetailSGDaoImpl implements DetailSGDao{
	private JdbcTemplate jdbcTemplate;

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	public SqlRowSet getListdetailData(String NO) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
		SqlRowSet l_sqs = jdbcTemplate.queryForRowSet("SELECT * FROM TBL_ZH_LIST WHERE ZH_NO = '"+NO+"'");
		return l_sqs;
	}
	
	public void updateListdetailData(String status,String modify_part,String modify, String mehood,String reason,String reasons,String modifydate,String no) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{
		String sql = "UPDATE TBL_ZH_LIST SET ZH_STATUS = '"+status+"', MODIFY_PART = '"+modify_part+"', ZH_MODIFY = '"+modify+"',MEHOOD = '"+mehood+"',REASON = '"+reason+"',REASONS = '"+reasons+"',EDIT_DATE = '"+modifydate+"' WHERE ZH_NO = '"+no+"'";
		System.out.println(sql);
		jdbcTemplate.update(sql);
	}
}
